home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / gutenprint / paper.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-03-15  |  3.4 KB  |  134 lines

  1. /*
  2.  * "$Id: paper.h,v 1.1 2004/09/17 18:38:01 rleigh Exp $"
  3.  *
  4.  *   libgimpprint paper functions.
  5.  *
  6.  *   Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
  7.  *    Robert Krawitz (rlk@alum.mit.edu)
  8.  *
  9.  *   This program is free software; you can redistribute it and/or modify it
  10.  *   under the terms of the GNU General Public License as published by the Free
  11.  *   Software Foundation; either version 2 of the License, or (at your option)
  12.  *   any later version.
  13.  *
  14.  *   This program is distributed in the hope that it will be useful, but
  15.  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  16.  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  17.  *   for more details.
  18.  *
  19.  *   You should have received a copy of the GNU General Public License
  20.  *   along with this program; if not, write to the Free Software
  21.  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22.  */
  23.  
  24. /**
  25.  * @file gutenprint/paper.h
  26.  * @brief Paper size functions.
  27.  */
  28.  
  29. #ifndef GUTENPRINT_PAPER_H
  30. #define GUTENPRINT_PAPER_H
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #include <gutenprint/vars.h>
  37.  
  38. /**
  39.  * The papersize describes the dimensions of a paper.
  40.  *
  41.  * @defgroup papersize papersize
  42.  * @{
  43.  */
  44.  
  45.  
  46.  
  47. /**
  48.  * Units of measurement.
  49.  */
  50. typedef enum
  51. {
  52.   /** English/Imperial units. */
  53.   PAPERSIZE_ENGLISH_STANDARD,
  54.   /** Metric units. */
  55.   PAPERSIZE_METRIC_STANDARD,
  56.   /** English/Imperial units (optional paper, not displayed by default). */
  57.   PAPERSIZE_ENGLISH_EXTENDED,
  58.   /** Metric units (optional paper, not displayed by default). */
  59.   PAPERSIZE_METRIC_EXTENDED
  60. } stp_papersize_unit_t;
  61.  
  62. /** The papersize data type. */
  63. typedef struct
  64. {
  65.   /** Short unique name (not translated). */
  66.   char *name;
  67.   /** Long descriptive name (translated). */
  68.   char *text;
  69.   /** Comment. */
  70.   char *comment;
  71.   /** Paper width. */
  72.   unsigned width;
  73.   /** Paper height. */
  74.   unsigned height;
  75.   /** Top margin. */
  76.   unsigned top;
  77.   /** Left margin. */
  78.   unsigned left;
  79.   /** Bottom margin. */
  80.   unsigned bottom;
  81.   /** Right margin. */
  82.   unsigned right;
  83.   /** Units of measurement. */
  84.   stp_papersize_unit_t paper_unit;
  85. } stp_papersize_t;
  86.  
  87. /**
  88.  * Get the number of available papersizes.
  89.  * @returns the number of papersizes.
  90.  */
  91. extern int stp_known_papersizes(void);
  92.  
  93. /**
  94.  * Get a papersize by name.
  95.  * @param name the short unique name of the paper.
  96.  * @returns a pointer to the papersize, or NULL on failure.  The
  97.  * pointer should not be freed.
  98.  */
  99. extern const stp_papersize_t *stp_get_papersize_by_name(const char *name);
  100.  
  101. /**
  102.  * Get a papersize by size.
  103.  * The nearest available size to the size requested will be found.
  104.  * @param length the length of the paper.
  105.  * @param width the width of the paper
  106.  * @returns a pointer to the papersize, or NULL on failure.  The
  107.  * pointer should not be freed.
  108.  */
  109. extern const stp_papersize_t *stp_get_papersize_by_size(int length,
  110.                             int width);
  111.  
  112. /**
  113.  * Get a papersize by its index number.
  114.  * @param idx the index number.  This must not be greater than (total
  115.  * number of papers - 1).
  116.  * @returns a pointer to the papersize, or NULL on failure.  The
  117.  * pointer should not be freed.
  118.  */
  119. extern const stp_papersize_t *stp_get_papersize_by_index(int idx);
  120.  
  121. extern void stp_default_media_size(const stp_vars_t *v,
  122.                    int *width, int *height);
  123.  
  124. /** @} */
  125.  
  126. #ifdef __cplusplus
  127.   }
  128. #endif
  129.  
  130. #endif /* GUTENPRINT_PAPER_H */
  131. /*
  132.  * End of "$Id: paper.h,v 1.1 2004/09/17 18:38:01 rleigh Exp $".
  133.  */
  134.